package com.itheima.d13_polimorphic;

public class Test {
    public static void main(String[] args) {
        // 1. 父类类型  子类对象
        Animal d  = new Dog();
        d.run();

        //向下转型
        Dog d2 = (Dog) d;
        d2.eat();


        Animal t = new Tortoise();
        if(t instanceof Tortoise){
            Tortoise t2 = (Tortoise) t;
        }

    }
}
